<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-用户信息</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<link rel="icon" href="js/dialog/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>	
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
<script type="text/javascript">
function deleteCheck(){
	var selected_value = [];    
	$("input[name='ids']:checked").each(function(){    
	 	selected_value.push("id="+$(this).val());    
	});    
	if(selected_value.length == 0) {
		$.dialog.alert("你还没有选择任何内容"); 
		return false;
	} 	
	$.dialog.confirm("确定要删除吗？", function(){
    	var url = "";
		for(var i =0;i<selected_value.length;i++){
			url=url+selected_value[i]+"&";
		}
		window.location.href="system/delUser.action?"+url;
	}, function(){
	    
	});
}
function checkAll(status){
	if(status){
		  $("input[name='ids']").each(function(){
			   $(this).attr("checked",true);
			  });  
	}
	if(!status){
		    $("input[name='ids']").each(function(){
			   $(this).attr("checked",false);
			  });  
	}
}
function editCheck(){
	var selected_value = [];    
	$("input[name='ids']:checked").each(function(){    
	 	selected_value.push($(this).val());    
	});    
	if(selected_value.length == 0) {
		$.dialog.alert("你还没有选择任何内容"); 
		return false;
	} else if(selected_value.length > 1){
		$.dialog.alert("一次只能修改一条记录！"); 
		return false;
	}
	//alert(selected_value[0]);
  window.location.href="system/modifyUser.action?id="+selected_value[0];
}
function setAuthority(){
	var selected_value = [];    
	$("input[name='ids']:checked").each(function(){    
	 	selected_value.push($(this).val());    
	});    
	if(selected_value.length == 0) {
		alert("你还没有选择任何内容"); 
		return false;
	} else if(selected_value.length > 1){
		alert("一次只能修改一条记录！"); 
		return false;
	}
  return selected_value[0];
}
</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
	    	<div class="topleft fl">系统菜单栏</div>
	    </td>
	    <td bgcolor="#e7e7e7" class=" bbt">
	    	<div class="topleft fl">您现在的位置：首页&nbsp;>&nbsp;<span>用户信息</span>
	    </div>
	    </td>
	</tr>
	<tr>
	    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
	    	<div class="left_bk">
	           <div class="menu2">
				<%@include file="system_left.jsp" %>
				</div>
			</div>
		</td>
	    <td align="left" valign="top" bgcolor="#FFFFFF">
		    <div class="content" >
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
			          <td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;"><div class="tt_back fl">用户信息</div><div class="fr"><img src="images/tit_right.jpg" alt="" width="103" height="38" /></div></td>
			        </tr>
			        <tr>
						<td class="borders btn">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
								    <td align="center">
									    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
											<tr align="left">
										        <td height="42" colspan="2">
										        <input type="button" id="addBt" style="cursor: pointer;" class="buttons2" value="新  增"
										        	onclick="location.href='system/gotoAddUser.action'" />
										        <input type="button" id="editBt" class="buttons2"  style="cursor: pointer;" value="修  改"
										        	onclick="editCheck()" />
										        <input type="button" class="buttons2" id="deleteBt" value="删  除" style="cursor: pointer;" 
										        	onclick="deleteCheck()" />
										        	<input type="button" class="buttons2" id="deleteBt" value="权限设置" style="cursor: pointer;" 
										        	onclick="if(setAuthority())location.href='system/setAuthority?id='+setAuthority();" />
										        </td>
											</tr>
									 		<tr>
										        <td colspan="2">
										        	<div style="height:305px">
											        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
														<tr class="captit">
												            <td width="4%" height="31" align="center" valign="middle">
												            	<input type="checkbox" class="checks" onclick="checkAll(this.checked)"/></td>
												            <td width="10%" height="31" align="center" valign="middle">账号</td>
												            <td width="8%" height="31" align="center" valign="middle">账户类型</td>
												            <td width="10%" height="31" align="center" valign="middle">姓名</td>
												            <td width="14%" height="31" align="center" valign="middle">身份证号码</td>
												            <td width="7%" height="31" align="center" valign="middle">职位</td>
												            <td width="6%" height="31" align="center" valign="middle">所属区域 </td>
												            <td width="10%" height="31" align="center" valign="middle">联系方式</td>
												            <td width="16%" height="31" align="center" valign="middle">住址</td>
												            <td width="15%" height="31" align="center" valign="middle">Email</td>
														</tr>
														<s:iterator value="admininfos" id="obj" >
														<tr height="26" bgcolor="#efefef">
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<input type="checkbox" name="ids" id="ids_<s:property value="#obj.id"/>" value="<s:property value="#obj.id"/>" />
												            </td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.username"/>
												            </td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            <s:if test="#obj.accountType == 1">
												                         系统管理员
												            </s:if>
												              <s:if test="#obj.accountType == 2">
												                         普通用户
												            </s:if>
												            </td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.fullName"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.cardNo"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.job"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.area"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#obj.phone"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" >
												            	<s:property value="#obj.addre"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" >
												            	<s:property value="#obj.email"/></td>
														</tr>
														</s:iterator>
													</table>
													</div>
										        </td>
											</tr>
											<tr>
										        <td width="30%" height="50">
											        
												</td>
										        <td width="70%">
													<table width="700" border="0" align="right" cellpadding="0" cellspacing="0">														
														<tr>
															<td width="100%" >${pager.paginationModel}</td>
														</tr>
													</table>
												</td>
											</tr>
									    </table>
								    </td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
		    </div>
	    </td>
	</tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>